#ifndef _COLLISION_COMPONENT_H_
#define _COLLISION_COMPONENT_H_

#include "Component.h"
#include "Rect.h"

enum CollisionType
{
    Solid,
    Death,
    Velocity
};

class Collision : public fe::Component
{
public:
    Collision(bool tile = false)
    {
        isTile = tile;
        collisionType = Solid;
    }
    Collision(int type, bool tile = false)
    //:fe::Component()
    {
        isTile = tile;
        collisionType = type;
    }
    void setRect(float x, float y, float w = 32.f, float h = 32.f) {
        rect.x = x;
        rect.y = y;
        rect.w = w;
        rect.h = h;
    }

    void setPosition(float x, float y) {
        rect.x = x;
        rect.y = y;
    }

    void move(int x, int y) {
        rect.x += x;
        rect.y += y;
    }

    fe::RectF& getRect() { return rect; } // for compatibility
    fe::RectF rect; // easy access

    int collisionType;
    bool isTile;
};


#endif
